package com.wing.wecom.controller;

import chat.qiye.wechat.sdk.api.oa.OaCheckInApi;
import chat.qiye.wechat.sdk.api.oa.param.AddCheckInUserFaceParam;
import chat.qiye.wechat.sdk.api.oa.param.GetCheckInDataParam;
import chat.qiye.wechat.sdk.api.oa.param.GetCheckInUserRuleParam;
import chat.qiye.wechat.sdk.api.oa.param.SetCheckInScheduleListParam;
import chat.qiye.wechat.sdk.api.oa.resp.*;
import chat.qiye.wechat.sdk.common.RespStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 打卡
 * @author : Hui.Wang [huzi.wh@gmail.com]
 * @version : 1.0
 * @date : 2021/9/14
 */
@RestController
public class CheckInController {

    @Resource
    OaCheckInApi oaCheckInApi;

    /**
     * 获取企业所有打卡规则
     * @return
     */
    @PostMapping("/checkIn/getCorpOption")
    public CorpCheckInRuleResp getCorpOption() {
        return oaCheckInApi.getCorpOption();
    }

    /**
     * 获取员工打卡规则
     * @param param
     * @return
     */
    @PostMapping("/checkIn/getUserOption")
    public UserCheckInRuleResp getUserOption(GetCheckInUserRuleParam param) {
        return oaCheckInApi.getUserOption(param);
    }

    /**
     * 获取打卡记录数据
     * @param param
     * @return
     */
    @PostMapping("/checkIn/getData")
    public CheckInDataResp getData(GetCheckInDataParam param) {
        return oaCheckInApi.getData(param);
    }

    /**
     * 获取打卡日报数据
     * @param param
     * @return
     */
    @PostMapping("/checkIn/getDayData")
    public CheckInDayDataResp getDayData(GetCheckInDataParam param) {
        return oaCheckInApi.getDayData(param);
    }

    /**
     * 获取打卡月报数据
     * @param param
     * @return
     */
    @PostMapping("/checkIn/getMonthData")
    public CheckInMonthDataResp getMonthData(GetCheckInDataParam param) {
        return oaCheckInApi.getMonthData(param);
    }

    /**
     * 获取打卡人员排班信息
     * @param param
     * @return
     */
    @PostMapping("/checkIn/getUserScheduleList")
    public CheckInUserScheduleListResp getUserScheduleList(GetCheckInDataParam param) {
        return oaCheckInApi.getUserScheduleList(param);
    }

    /**
     * 为打卡人员排班
     * @param param
     * @return
     */
    @PostMapping("/checkIn/setUserScheduleList")
    public RespStatus setUserScheduleList(SetCheckInScheduleListParam param) {
        return oaCheckInApi.setUserScheduleList(param);
    }

    /**
     * 录入打卡人员人脸信息
     * @param param
     * @return
     */
    @PostMapping("/checkIn/addUserFace")
    public RespStatus addUserFace(AddCheckInUserFaceParam param) {
        return oaCheckInApi.addUserFace(param);
    }

}
